<template>
  <page-layout :title="'订单编号：'+detail.orderNo+'            下单时间：'+detail.createTime">
    <!-- actions -->
    <template slot="action">
      <a-button-group style="margin-right: 4px;">
        <a-button @click="sRemark=true">订单备注</a-button>
      </a-button-group>
      <a-button type="primary" @click="handleEditGJ(detail)"
                v-if="detail.status==1&&((shopType==1&&detail.shopId=='A00001A00001')||shopType==3)">修改价格
      </a-button>
      <a-button type="primary" @click="handleEditFH(detail)"
                v-if="detail.status==4&&((shopType==1&&detail.shopId=='A00001A00001'&&!detail.supplierId)||(shopType==3||shopType==4))">
        发货
      </a-button>
      <a-button type="primary" @click="handleEditWL(detail)"
                v-if="detail.status==3&&((shopType==1&&detail.shopId=='A00001A00001'&&!detail.supplierId)||(shopType==3||shopType==4))">
        修改物流
      </a-button>
    </template>
    <a-row slot="extra" class="status-list">
      <a-col :xs="24" :sm="24">
        <div class="text">订单状态</div>
        <div class="heading">{{ detail.status_dictText }}</div>
      </a-col>
    </a-row>
    <detail-list slot="headerContent" size="small">
      <detail-list-item term="实付金额">{{ detail.amount }}</detail-list-item>
      <detail-list-item term="付款方式">{{ detail.payChannel_dictText }}</detail-list-item>
      <detail-list-item term="付款时间">{{ detail.payTime }}</detail-list-item>
      <detail-list-item term="买家">{{ detail.nickname }}</detail-list-item>
      <detail-list-item term="买家手机号">{{ detail.phone }}</detail-list-item>
      <detail-list-item term="买家备注">{{ detail.customerRemark }}</detail-list-item>
    </detail-list>

    <a-row v-if="detail.invoiceType&&detail.invoicePhone" style="margin-bottom: 15px">
      <a-col :xs="24" :sm="24">
        <a-card title="发票信息" size="small">
          <detail-list :col="2">
            <detail-list-item term="发票类型">
              {{ detail.invoiceType == null || detail.invoicePhone == null ? "无发票" : detail.invoiceType == 1 ? '个人发票' : '企业发票' }}
            </detail-list-item>
            <detail-list-item term="收票人手机号">{{ detail.invoicePhone }}</detail-list-item>
            <detail-list-item term="收票人邮箱">{{ detail.invoiceMail }}</detail-list-item>
            <detail-list-item term="单位名称" v-if="detail.invoiceCompanyName&&detail.invoiceType == 2">
              {{ detail.invoiceCompanyName }}
            </detail-list-item>
            <detail-list-item term="纳税人识别号" v-if="detail.invoiceCompanyCode&&detail.invoiceType == 2">
              {{ detail.invoiceCompanyCode }}
            </detail-list-item>
          </detail-list>
        </a-card>
      </a-col>
    </a-row>

    <a-row>
      <a-col :xs="12" :sm="12">
        <a-card title="收件人信息" size="small">
          <detail-list :col="2">
            <detail-list-item term="收货人姓名">{{ detail.addressInfoObj.name }}</detail-list-item>
            <detail-list-item term="收货人电话">{{ detail.addressInfoObj.tel }}</detail-list-item>
            <detail-list-item term="省市区县">
              {{ detail.addressInfoObj.fullName ? detail.addressInfoObj.fullName.split(' ')[0] : '' }}
            </detail-list-item>
            <detail-list-item term="详细地址">{{ detail.addressInfoObj.fullName }}</detail-list-item>
          </detail-list>
        </a-card>
      </a-col>
      <a-col :xs="12" :sm="12">
        <a-card title="订单进度2" v-if="detail.status==5" size="small">
          <div style="padding:22px 0;">
            <a-steps :direction="isMobile() && 'vertical' || 'horizontal'" :current="0">
              <a-step title="交易取消">
              </a-step>
            </a-steps>
          </div>

        </a-card>
        <a-card title="订单进度" v-else size="small">
          <div style="padding:22px 0;">
            <a-steps :direction="isMobile() && 'vertical' || 'horizontal'" :current="detail.status-1">
              <a-step title="买家下单">
              </a-step>
              <a-step title="买家付款">
              </a-step>
              <a-step title="平台发货">
              </a-step>
              <a-step title="买家评价">
              </a-step>
              <a-step title="交易成功">
              </a-step>
            </a-steps>
          </div>
        </a-card>

      </a-col>
    </a-row>

    <!-- 包裹信息 -->
    <a-card title="包裹信息" size="small" style="margin-top: 15px">
      <a-tabs default-active-key="1">
        <a-tab-pane v-for="(item,index) in detail.packagesObj" :key="index" :tab="'包裹'+(index+1)">
          <a-table :columns="packagesColumns" :dataSource="[item]" :pagination="false" size="small">
            <template slot="sendTime" slot-scope="text">
              {{ text|timestampToTime }}
            </template>
            <template slot="logisticsCompany" slot-scope="text,record">
              {{ record.logisticsCompany.label }}
            </template>

            <template slot="good_items" slot-scope="text, record">
              <div v-for="(item,index) in record.items" :key="index" style="display:flex;">
                <div style="padding:5px;">
                  <img style="width:40px;" :src="item.imgUrl">
                </div>
                <div style="line-height:25px;">
                  <div>{{ item.spuName }}</div>
                  <div>{{ item.skuName }}</div>
                </div>
              </div>
            </template>
          </a-table>
        </a-tab-pane>

      </a-tabs>
    </a-card>

    <!-- 商品信息 -->
    <a-card title="商品信息" size="small" style="margin-top: 15px">
      <a-table :columns="shopType==4?goodsColumns1:goodsColumns" :dataSource="detail.skuList" bordered
               :pagination="false" size="small">
        <template slot="shopName">
          {{ detail.shopName }}
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else height="55px" :src="text" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="refundStatus" slot-scope="text,record">
          <span v-if="record.refundNo">{{ record.refundStatus == 2 ? '退款成功' : '退款中' }}</span>
          <a v-else-if="(detail.status==4)&&(shopType==1||shopType==3)" @click="activeRefund(record)">可主动退款</a>
        </template>
        <template slot="supplyPrice" slot-scope="text,record">
          <span>{{ (record.subSupplyPrice / record.num).toFixed(2) }}</span>
        </template>

        <template slot="supplyTotal" slot-scope="text,record">
          <span>{{ (record.subSupplyPrice ).toFixed(2) }}</span>
        </template>


        <template slot="subTotal" slot-scope="text,record">
          <span>{{ (record.subTotal * 1 + record.changePrice * 1 - record.couponDiscount * 1 - record.shopCouponDiscount * 1 - record.integralDiscount * 1).toFixed(2) }}</span>
          <span style="padding-left:10px;" v-if="record.changePrice*1>0||record.changePrice*1<0">
            <a-tooltip>
              <template slot="title">
                原价：{{ record.subTotal }}
              </template>
              <a-icon type="exclamation-circle"/>
            </a-tooltip>
          </span>
        </template>

      </a-table>
      <div style="font-size:14px;font-weight:500;line-height:22px;color:rgba(0, 0, 0, 0.85);" v-if="shopType!=4">
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">商品总价：</div>
          <div style="width:70px;">￥{{ goods_sum }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">商家改价：</div>
          <div style="width:70px;">￥{{ change_sum }}</div>
        </div>
        <div style="display:flex;">

          <div style="flex:1;text-align:right;">
            <a-tooltip>
              <template slot="title">
                原运费：￥{{ detail.originalFreight }}
              </template>
              <a-icon type="exclamation-circle"/>
            </a-tooltip>
            运费：
          </div>
          <div style="width:70px;">￥{{ detail.freight }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">会员折扣：</div>
          <div style="width:70px;">￥{{ discountInfo.vipDiscount }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">平台优惠：</div>
          <div style="width:70px;">￥{{ discountInfo.couponDiscount }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">店铺优惠：</div>
          <div style="width:70px;">￥{{ discountInfo.shopCouponDiscount }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">积分抵扣：</div>
          <div style="width:70px;">￥{{ discountInfo.integralDiscount }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">余额抵扣：</div>
          <div style="width:70px;">￥{{ discountInfo.balanceDiscount }}</div>
        </div>
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">实付金额：</div>
          <div style="width:70px;">￥{{ detail.amount }}</div>
        </div>
      </div>
      <div style="font-size:14px;font-weight:500;line-height:22px;color:rgba(0, 0, 0, 0.85);" v-if="shopType==4">
        <div style="display:flex;">
          <div style="flex:1;text-align:right;">总计：</div>
          <div style="width:70px;">￥{{ goods_sum }}</div>
        </div>

      </div>
    </a-card>

    <!-- 商品信息 -->
    <a-card title="支付信息" size="small" style="margin-top: 15px">
      <a-table :columns="payColumns" :dataSource="payOrderList" bordered :pagination="false" size="small">
        <template slot="payAmountType" slot-scope="text">
          <div v-if="text==1">商城订单</div>
          <div v-if="text==3">充值钱包</div>
          <div v-if="text==4">预售订单-定金</div>
          <div v-if="text==5">预售订单-尾款</div>
          <div v-if="text==6">拼团下单</div>
        </template>
        <template slot="amountSlot" slot-scope="text,record">
          <!-- <div>{{detail.amount+discountInfo.balanceDiscount}}</div> -->
          <div v-if="record.type==1||record.type==6">{{ goods_sum }}</div>
          <div v-if="record.type==4">{{ detail.skuList[0].deposit }}</div>
          <div v-if="record.type==5">{{ detail.skuList[0].subTotal * 1 - detail.skuList[0].deposit * 1|numToFixed2 }}
          </div>
        </template>
        <template slot="PayStatus" slot-scope="text">
          <div v-if="text==0">待支付</div>
          <div v-if="text==1">支付成功</div>
          <div v-if="text==3">订单关闭</div>
        </template>

      </a-table>
    </a-card>

    <!-- 分销信息 -->
    <a-card title="分销信息" size="small" style="margin-top: 15px" v-if="shopType==1">
      <a-table :columns="handColumns" :dataSource="handList" bordered :pagination="false" size="small">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="settlementStatus" slot-scope="text,record">
          <span v-if="record.refundNo">{{ record.refundStatus == 2 ? '退款成功' : '退款中' }}</span>
          <span v-else>{{ text == 1 ? '已结算' : '未结算' }}</span>
        </template>

        <template slot="nickname" slot-scope="text,record">
          <span>{{ text ? text : record.phone }}</span>
        </template>

        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="55px" alt=""
               style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
            下载
          </a-button>
        </template>
      </a-table>
    </a-card>

    <a-modal title="主动退款" :visible="active_refund_visible" :confirm-loading="active_refund_confirmLoading"
             @ok="activeRefundOk"
             @cancel="handleCancel">
      <p>
        主动退款金额：
        <a-input-number placeholder="主动退款金额" :min="0.01" :precision="2" v-model="active_refund_amount"
                        :max="max_refund_amount"></a-input-number>
      </p>
      <p>
        主动退款原因：
        <a-input placeholder="主动退款原因" v-model="active_refund_reason"></a-input>
      </p>
    </a-modal>
    <a-modal title="订单备注" :visible="sRemark" :confirm-loading="active_refund_confirmLoading" @ok="upRemark"
             @cancel="sRemark= false">
      <p>
        <a-textarea placeholder="请输入内容" :rows="4" v-model="shopRemark"/>
      </p>

    </a-modal>

    <deliver-modal ref="deliverForm" @ok="modalFormOk"/>
    <remark-modal ref="remarkForm" @ok="modalFormOk"/>
    <update-modal ref="updateForm" @ok="modalFormOk"/>
    <change-deliver ref="changeDeliver" @ok="modalFormOk"/>
    <deliver-modal-cal ref="deliverFormCal" @ok="modalFormOk"/>
    <change-deliver-cal ref="changeDeliverCal" @ok="modalFormOk"/>
  </page-layout>
</template>

<script>
import Vue from 'vue'
import {SHOP_TYPE, ORG_CODE} from "@/store/mutation-types"
import {postAction, getAction} from '@/api/manage'
import {mixinDevice} from '@/utils/mixin.js'
import PageLayout from '@/components/page/PageLayout'
import DetailList from '@/components/tools/DetailList'
import DeliverModal from './DeliverModal'
import DeliverModalCal from './DeliverModalCal'
import ChangeDeliver from './ChangeDeliver'
import ChangeDeliverCal from './ChangeDeliverCal'
import RemarkModal from './RemarkModal'
import UpdateModal from './UpdateModal'
import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil'

const DetailListItem = DetailList.Item
export default {
  name: "Advanced",
  components: {
    PageLayout,
    DetailList,
    DetailListItem,
    DeliverModal, UpdateModal, RemarkModal, ChangeDeliver, DeliverModalCal, ChangeDeliverCal
  },
  mixins: [mixinDevice],
  data() {
    return {
      //当前用户店铺类型1:平台，2：自营，3：店铺，4：供应商
      shopType: Vue.ls.get(SHOP_TYPE),
      //当前用户部门code
      orgCode: Vue.ls.get(ORG_CODE),
      active_refund_orderSkuId: '',
      active_refund_visible: false,
      active_refund_confirmLoading: false,
      active_refund_amount: 0,
      max_refund_amount: 0,
      active_refund_reason: '',
      sRemark: false,
      shopRemark: '',
      tabList: [],
      activeTabKey: '1',
      packagesColumns: [
        {
          title: '快递名称',
          dataIndex: 'logisticsCompany',
          key: 'logisticsCompany',
          scopedSlots: {customRender: 'logisticsCompany'},
        },
        {
          title: '物流单号',
          dataIndex: 'logisticsNo',
          key: 'logisticsNo'
        },
        {
          title: '发货时间',
          dataIndex: 'sendTime',
          key: 'sendTime',
          scopedSlots: {customRender: 'sendTime'},
        },
        {
          title: '商品信息',
          dataIndex: 'items',
          key: 'items',
          scopedSlots: {customRender: 'good_items'},
        }
      ],
      operation: [],
      detail: {
        orderNo: '',
        type: '',//商品类型：1=普通商品，2=礼包商品，3=拼团商品，4=砍价商品，5=预售商品
        addressInfoObj: {}
      },
      goodsColumns: [
        {
          title: '店铺',
          dataIndex: 'id',
          key: 'id',
          scopedSlots: {customRender: 'shopName'},
        },
        {
          title: '商品图片',
          dataIndex: 'imgUrl',
          key: 'imgUrl',
          scopedSlots: {customRender: 'imgSlot'},
        },
        {
          title: '商品标题',
          dataIndex: 'spuName',
          key: 'spuName'
        },
        {
          title: '规格',
          dataIndex: 'skuName',
          key: 'skuName'
        },
        {
          title: '单价',
          dataIndex: 'skuPrice',
          key: 'skuPrice'
        },
        {
          title: '数量',
          dataIndex: 'num',
          key: 'num'
        },
        {
          title: '会员折扣',
          dataIndex: 'vipDiscount',
          key: 'vipDiscount'
        },
        {
          title: '店铺优惠',
          dataIndex: 'shopCouponDiscount',
          key: 'shopCouponDiscount'
        },
        {
          title: '平台优惠',
          dataIndex: 'couponDiscount',
          key: 'couponDiscount'
        },
        {
          title: '积分抵扣',
          dataIndex: 'integralDiscount',
          key: 'integralDiscount'
        },
        {
          title: '商家改价',
          dataIndex: 'changePrice',
          key: 'changePrice'
        },
        // {
        //   title: '余额抵扣',
        //   dataIndex: 'balanceDiscount',
        //   key: 'balanceDiscount'
        // },
        {
          title: '小计(元)',
          dataIndex: 'subTotal',
          key: 'subTotal',
          scopedSlots: {customRender: 'subTotal'}
        },
        {
          title: '售后状态',
          dataIndex: 'refundStatus',
          key: 'refundStatus',
          scopedSlots: {customRender: 'refundStatus'}
        }

      ],
      //供应商表头
      goodsColumns1: [
        {
          title: '商品图片',
          dataIndex: 'imgUrl',
          key: 'imgUrl',
          scopedSlots: {customRender: 'imgSlot'},
        },
        {
          title: '商品标题',
          dataIndex: 'spuName',
          key: 'spuName'
        },
        {
          title: '规格',
          dataIndex: 'skuName',
          key: 'skuName'
        },
        {
          title: '供应价',
          dataIndex: 'subSupplyPrice',
          key: 'subSupplyPrice',
          scopedSlots: {customRender: 'supplyPrice'}
        },
        {
          title: '数量',
          dataIndex: 'num',
          key: 'num'
        },
        {
          title: '小计(元)',
          dataIndex: 'subTotal',
          key: 'subTotal',
          scopedSlots: {customRender: 'supplyTotal'}
        },
        {
          title: '售后状态',
          dataIndex: 'refundStatus',
          key: 'refundStatus',
          scopedSlots: {customRender: 'refundStatus'}
        }

      ],
      handList: [],
      // 表头
      handColumns: [
        {
          title: '分销商品',
          align: "center",
          dataIndex: 'spuName'
        },
        {
          title: '规格',
          align: "center",
          dataIndex: 'skuName'
        },
        {
          title: '昵称',
          align: "center",
          dataIndex: 'nickname',
          scopedSlots: {customRender: 'nickname'}
        },
        {
          title: '会员等级',
          align: "center",
          dataIndex: 'levelName'
        },
        {
          title: '奖励名称',
          align: "center",
          dataIndex: 'title'
        },
        {
          title: '收益金额（元）',
          align: "right",
          dataIndex: 'amount'
        },
        {
          title: '结算状态',
          align: "center",
          dataIndex: 'isSettled',
          scopedSlots: {customRender: 'settlementStatus'}
        }
      ],
      // 表头
      payColumns: [
        {
          title: '支付号',
          align: "center",
          dataIndex: 'payOrderNo'
        },
        {
          title: '实付金额',
          align: "center",
          dataIndex: 'payAmount'
        },
        {
          title: '金额',
          align: "center",
          dataIndex: 'amount',
          scopedSlots: {customRender: 'amountSlot'}
        },
        {
          title: '支付类型',
          align: "center",
          dataIndex: 'type',
          scopedSlots: {customRender: 'payAmountType'}
        },
        {
          title: '支付状态',
          align: "center",
          dataIndex: 'status',
          scopedSlots: {customRender: 'PayStatus'}
        }
      ],
      payOrderList: [],
      discountInfo: {},
      goods_sum: 0,//商品小计
      change_sum: 0//改价小计
    }
  },
  created() {
    if (this.$route.query.id) {
      this.detail.orderNo = this.$route.query.id
      this.detail.type = this.$route.query.type//商品类型：1=普通商品，2=礼包商品，3=拼团商品，4=砍价商品，5=预售商品
      this.loadInfo()
      this.loadHand()
      this.loadPayOrderList()
      this.loadDiscountInfo()
    }

  },
  methods: {
    modalFormOk() {
      // 新增/修改 成功时，重载
      this.loadInfo()

    },
    upRemark() {
      const self = this
      postAction('/mallBase/omsOrder/orderRemark', {
        orderNo: self.detail.orderNo,
        remark: self.shopRemark
      }).then(res => {
        self.sRemark = false
        self.$emit('ok')
      })
    },
    loadInfo() {
      const self = this
      let url = ""
      if (self.detail.type == 1) {
        url = "/mallBase/omsOrder/queryById"//普通订单
      } else if (self.detail.type == 5) {
        url = "/mallPlus/omsOrder/queryByPreId"//预售订单
      } else if (self.detail.type == 3) {
        url = "/mallPlus/omsOrder/queryByPtOrderId"//预售订单
      } else {
        url = "/mallBase/omsOrder/queryById"//普通订单
      }
      getAction(url, {
        id: self.detail.orderNo
      }).then(res => {
        self.tabList = []
        self.operation = []
        self.detail = res.result
        if (self.detail.packagesObj && self.detail.packagesObj.length > 0) {
          for (let i = 0; i < self.detail.packagesObj.length; i++) {
            self.tabList.push({
              key: i,
              tab: '包裹' + (i + 1)
            })
          }
          self.operation.push(self.detail.packagesObj[0])
        }
        self.goods_sum = 0
        self.change_sum = 0
        for (let j = 0; j < self.detail.skuList.length; j++) {
          self.goods_sum = self.goods_sum + Number(self.detail.skuList[j].subSupplyPrice * 1)
          self.change_sum = self.change_sum + Number(self.detail.skuList[j].changePrice * 1)
        }

      })
    },
    loadHand() {
      getAction("/member/umsBalanceLog/customList", {
        orderNo: this.detail.orderNo,
        pageNo: 1,
        pageSize: 1000
      }).then((res) => {
        if (res.success) {
          this.handList = res.result.records
        }
      })
    },
    loadPayOrderList() {
      getAction("/mallBase/omsPayOrder/customPrePayInfo", {orderNo: this.detail.orderNo}).then((res) => {
        if (res.success) {
          this.payOrderList = res.result
        }
      })
    },
    loadDiscountInfo() {
      getAction("/mallBase/omsOrder/queryOrderDiscount", {id: this.detail.orderNo}).then((res) => {
        if (res.success) {
          this.discountInfo = res.result
        }
      })
    },

    activeRefund(item) {
      this.active_refund_orderSkuId = item.id
      this.active_refund_visible = true
      this.max_refund_amount = item.subTotal - parseFloat((item.shopCouponDiscount * 1 + item.couponDiscount * 1 + item.integralDiscount * 1) || 0) + parseFloat(item.changePrice || 0)
      this.active_refund_amount = (item.subTotal - parseFloat((item.shopCouponDiscount * 1 + item.couponDiscount * 1 + item.integralDiscount * 1) || 0) + parseFloat(item.changePrice || 0)).toFixed(2)
      this.active_refund_reason = ""
    },
    handleCancel(e) {
      this.active_refund_visible = false
    },
    activeRefundOk() {
      let self = this
      if (self.active_refund_amount < 0.01) {
        self.$message.warning("主动退款金额不能小于0.01")
        return
      }
      if (!self.active_refund_reason) {
        self.$message.warning("主动退款原因不能为空")
        return
      }
      self.active_refund_confirmLoading = true
      postAction('/mallBase/omsOrderRefund/activeRefund', {
        orderSkuId: self.active_refund_orderSkuId,
        refundPrice: parseFloat(self.active_refund_amount),
        closeReason: self.active_refund_reason
      }).then(res => {
        self.active_refund_confirmLoading = false
        self.active_refund_visible = false
        self.modalFormOk()
      }).catch(() => {
        self.active_refund_confirmLoading = false
        self.active_refund_visible = false
      })
    },
    handleEditFH(record) {
      console.log(record)
      this.$refs.deliverForm.edit(record)
      this.$refs.deliverForm.title = '发货'
      this.$refs.deliverForm.ruleForm.orderNo = record.orderNo
    },
    handleEditWL(record) {
      console.log(record)
      this.$refs.changeDeliver.edit(record)
    },
    handleEditBZ(record) {
      console.log(record)
      this.$refs.remarkForm.edit(record)
      this.$refs.remarkForm.title = '备注'
      this.$refs.remarkForm.ruleForm.orderNo = record.orderNo
    },
    handleEditGJ(record) {
      this.$refs.updateForm.title = '修改价格'
      this.$refs.updateForm.ruleForm.orderNo = record.orderNo
      this.$refs.updateForm.edit(record)
    },


    handleCalEditFH(record) {
      console.log(record)
      this.$refs.deliverFormCal.edit(record)
      this.$refs.deliverFormCal.title = '发货'
      this.$refs.deliverFormCal.ruleForm.orderNo = record.id
    },
    handleCalEditWL(record) {
      console.log(record)
      this.$refs.changeDeliverCal.edit(record)
    },
  },

}
</script>

<style lang="less" scoped>
.detail-layout {
  margin-left: 44px;
}

.text {
  color: rgba(0, 0, 0, 0.45);
}

.heading {
  color: rgba(0, 0, 0, 0.85);
  font-size: 20px;
}

.no-data {
  color: rgba(0, 0, 0, 0.25);
  text-align: center;
  line-height: 64px;
  font-size: 16px;

  i {
    font-size: 24px;
    margin-right: 16px;
    position: relative;
    top: 3px;
  }
}

.mobile {
  .detail-layout {
    margin-left: unset;
  }

  .status-list {
    text-align: left;
  }
}
</style>
